import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { LoginComponent } from './login/login.component'
import { AdministratorComponent } from './administrator/administrator.component';
import { EmployeeComponent} from './employee/employee.component';
import { ManagerComponent } from './manager/manager.component';
import { ViceGeneralManagerComponent } from './vice-general-manager/vice-general-manager.component';
import { DepartmentManagerComponent } from './department-manager/department-manager.component';
import { RouteguardService } from './services/routeguard.service';
const routes: Routes = [
  { path: '', redirectTo: 'login', pathMatch: 'full'},
  { path: 'login', component: LoginComponent },
  { path: 'admin', component: AdministratorComponent, canActivate: [RouteguardService] },
  { path: 'employee', component: EmployeeComponent, canActivate: [RouteguardService] },
  { path: 'viceGeneralManager', component: ViceGeneralManagerComponent, canActivate: [RouteguardService]},
  { path: 'departmentManager', component:DepartmentManagerComponent, canActivate: [RouteguardService]},
  { path: 'manager', component: ManagerComponent, canActivate: [RouteguardService]},
];

@NgModule({
  imports: [RouterModule.forRoot(routes)],
  exports: [RouterModule]
})
export class AppRoutingModule { }
